package net.esj.auth.inst.struts2;

import javax.inject.Inject;

import net.esj.auth.manager.AuthManager;
import net.esj.auth.pojo.CoreAuthModel;
import net.esj.basic.exception.MelonException;
import net.esj.basic.plugins.struts2.Immit;

public class ModelAction extends AbstractAuthAction<CoreAuthModel, CoreAuthModel> {

	private AuthManager authManager;
	
	public void doAdd() throws MelonException{
			authManager.saveOrUpdateModel(entity);
	}
	
	
	@Override
	public void doUpdate(){
		authManager.saveOrUpdateModel(entity);
	}

	public CoreAuthModel getEntity() {
		return entity;
	}

	public void setEntity(CoreAuthModel entity) {
		this.entity = entity;
	}
	
	@Inject
	public void setAuthManager(AuthManager authManager) {
		this.authManager = authManager;
	}
}
